<template>
  <div class="breadcrumb">
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <template v-if="route.path !== '/index'">
        <el-breadcrumb-item
        v-for="item in route.matched"
        :key="item.name"
        :to="{ path: item.path }"
        >{{ item.meta.title }}</el-breadcrumb-item
      >
      </template>
    </el-breadcrumb>

  </div>
</template>

<script lang="ts" setup>
import { ref } from "vue";
import { useRoute } from "vue-router";
const route = useRoute();
console.log(route.meta);
</script>

<style lang="scss" scoped>
.breadcrumb{
  margin-bottom: 20px;
}

</style>
